using System;
using System.Collections.Generic;
using System.Text;
using MacomberMap.Common.User_Interfaces.Components;
using System.Data.Common;
using System.Xml;
using MacomberMap.Common.Types;

namespace MacomberMap.Common.Components
{
    /// <summary>
    /// This class holds information on a DC Tie
    /// </summary>
    [MM_Serializable_Target(MM_Serializable_Target.enumTargetType.TypeCollection)]
    public class MM_DCTie: MM_Element
    {
        #region Variable declarations
        /// <summary>The unit associated with the DC Tie</summary>
        [MM_Serializable_Target(MM_Serializable_Target.enumTargetType.TypeCollection)]
        public MM_Unit Unit;

        /// <summary>The load associated with the DC Tie</summary>
        [MM_Serializable_Target(MM_Serializable_Target.enumTargetType.TypeCollection)]
        public MM_Element Load;

        /// <summary>The line associated with the DC Tie</summary>
        [MM_Serializable_Target(MM_Serializable_Target.enumTargetType.TypeCollection)]
        public MM_Line AssociatedLine;

        /// <summary>Hide TEID from DC Ties</summary>
        [MM_Serializable_Target(MM_Serializable_Target.enumTargetType.None)]
        public new UInt64 TEID = 0;

        /// <summary>Ensure the name is our new primary key</summary>
        [MM_Serializable_Target(MM_Serializable_Target.enumTargetType.Index)]
        public new String Name;
        #endregion

        #region Initialization
        /// <summary>
        /// Initialize a new DC Tie
        /// </summary>
        public MM_DCTie()
            : base()
        {
            this.ElemType = MM_Overall_Display.ElemTypes["DCTie"];
        }

        /// <summary>
        /// Initialize a new DC Tie
        /// </summary>
        /// <param name="TieData"></param>
        public MM_DCTie(DbDataReader TieData)
            : base(TieData)
        {
            this.ElemType = MM_Overall_Display.ElemTypes["DCTie"];
        }

        /// <summary>
        /// Initialize a new DC Tie
        /// </summary>
        /// <param name="TieData"></param>
        public MM_DCTie(XmlElement TieData)
            : base(TieData)
        {
            this.ElemType = MM_Overall_Display.ElemTypes["DCTie"];
        }
        #endregion
    }
}
